package com.ylkj.wx.constant;


/**
 * 
 * <p> 项目中使用的所有常量</p>
 * <p>2016年05月03日 下午2:58:31</p>
 * <p>Copyright ® 2016 东软熙康健康科技有限公司</p>
 */
public class WeiXBaseConstant {
	
    /**
     * 分页获取医生列表时，每页大小
     */
    public static final int DOCTOR_PAGE_SIZE = 10;
    
    /**
     * 分页获取部门列表时，每页大小
     */
    public static final int DEPARTMENT_PAGE_SIZE = 10000;
    
    /**
     * 分页获取我的订单列表时，每页大小
     */
    public static final int ORDER_PAGE_SIZE = 8;
    
    /**
     * 开始页码
     */
    public static final int START_PAGE_INDEX = 0;
    
    /**
     * 结束页码
     */
    public static final int END_PAGE_INDEX = Integer.MAX_VALUE;
    
    /**
     * doctorId的长度
     */
    public static final int DOCTOR_ID_LENGTH = 8;
    
    /**
     * 请求消息类型：文本
     */
	public static final String REQ_MESSAGE_TYPE_TEXT = "text";

    /**
     * 请求消息类型：图片
     */
	public static final String REQ_MESSAGE_TYPE_IMAGE = "image";
	
    /**
     * 请求消息类型：语音
     */
	public static final String REQ_MESSAGE_TYPE_VOICE = "voice";

    /**
     * 请求消息类型：视频
     */
	public static final String REQ_MESSAGE_TYPE_VIDEO = "video";

    /**
     * 请求消息类型：地理位置
     */
	public static final String REQ_MESSAGE_TYPE_LOCATION = "location";

    /**
     * 请求消息类型：链接
     */
	public static final String REQ_MESSAGE_TYPE_LINK = "link";
	
    /**
     * 请求消息类型：事件推送
     */
	public static final String REQ_MESSAGE_TYPE_EVENT = "event";
	
	
    /**
     * 事件类型：shortvideo(小视频)
     */
	public static final String EVENT_TYPE_SHORTVIDEO = "shortvideo";

    /**
     * 事件类型：subscribe(订阅)
     */
	public static final String EVENT_TYPE_SUBSCRIBE = "subscribe";

    /**
     * 事件类型：unsubscribe(取消订阅)
     */
	public static final String EVENT_TYPE_UNSUBSCRIBE = "unsubscribe";

    /**
     * 事件类型：scan(用户已关注时的扫描带参数二维码)
     */
	public static final String EVENT_TYPE_SCAN = "SCAN";

    /**
     * 事件类型：LOCATION(上报地理位置)
     */
	public static final String EVENT_TYPE_LOCATION = "LOCATION";

    /**
     * 事件类型：CLICK(自定义菜单)
     */
	public static final String EVENT_TYPE_CLICK = "CLICK";
	
    /**
     * 响应消息类型：文本
     */
	public static final String RESP_MESSAGE_TYPE_TEXT = "text";

    /**
     * 响应消息类型：图片
     */
	public static final String RESP_MESSAGE_TYPE_IMAGE = "image";

    /**
     * 响应消息类型：语音
     */
	public static final String RESP_MESSAGE_TYPE_VOICE = "voice";

    /**
     * 响应消息类型：视频
     */
	public static final String RESP_MESSAGE_TYPE_VIDEO = "video";

    /**
     * 响应消息类型：音乐
     */
	public static final String RESP_MESSAGE_TYPE_MUSIC = "music";

    /**
     * 响应消息类型：图文
     */
	public static final String RESP_MESSAGE_TYPE_NEWS = "news";

    /**
     * 当前系统环境 integrate、xk、online
     */
	public final static  String SYSTEM_ENVIRONMENT = "integrate"; //System.getProperty("weichat.system.environment").trim();
    
    /**
     * 公众号的唯一标识
     */
    public static final String WEICHAT_APPID ;
    /**
     * 公众号的appsecret
     */
    public static final String WEICHAT_SECRET;

    /**
     * 商户号ID
     */
    public static final String WEICHAT_MCHID;

    /**
     *商户支付密钥
     */
    public static final String WEICHAT_MCH_KEY;
    
    /**
     * 微信域名
     */
    public static final String WEIXIN_DOMAIN_URL;
    
    /**
     * 支付回调URL
     */
    public static final String PAY_CALL_BACK_URL;
    
    /**
     * 服务类订单支付回调URL
     */
    public static final String SERVICE_PAY_CALL_BACK_URL;
    
    /**
     * person_SDK 服务方式常量
     */
    public static final String WEIXIN_TOKEN;
    
    /**
     * MY_DOCTOR 自定义菜单[我的医生]的key
     */
    public static final String MY_DOCTOR;
    
    /**
     * MY_SERVICE 自定义菜单[我的服务]的key
     */
    public static final String MY_SERVICE;
    
    /**
     * 消息模板
     * 
     * title:咨询提醒
     * {{first.DATA}}
     * 提醒内容：{{keyword1.DATA}}
     * 提醒时间：{{keyword2.DATA}}
     * {{remark.DATA}}
     * 
     */
    public static final String TEMPLATE_CONSULTING_REMIND;
    
    
    /**
     * 扫描带参数二维码事件的eventKey前缀
     */
    public static final String EVENT_KEY_QRSCENE = "qrscene_";
    
    /**
     * 微信用户详细信息
     */
    public static final String WEIXIN_USER_INFO = "_user_info";
    /**
     * 微信用户详细信息
     */
    public static final String WEIXIN_OPEN_ID = "_open_id";
    
    /**
     * 微信在redis中的域名
     */
    public static final String REDIS_SCOPE_CLOUDWEIX = "ch:hash:cloudweix";
    
    /**
     * access_token在redis中的key
     */
    public static final String ACCESS_TOKEN_KEY = "accessTokenKey";
    
    /**
     * jsapi_ticket在redis中的key
     */
    public static final String JSAPI_TICKET_KEY = "jsapiTicketKey";
    
    /**
     * 地址默认：yes
     */
    public static final String ADDRESS_IS_DEFAULT = "YES";
    
    /**
     * 地址默认：no
     */
    public static final String ADDRESS_IS_NOT_DEFAULT = "NO";
    
    /**
    * 排班时段：AM
    */
   public static final String SCHEDULING_PERIOD_AM = "AM";
   
   /**
    * 排班时段：PM
    */
   public static final String SCHEDULING_PERIOD_PM = "PM";
   
   /**
    * 排班时段：NIGHT
    */
   public static final String SCHEDULING_PERIOD_NIGHT = "NIGHT";
   
   /**
    * 证件类型：身份证
    */
   public static final String PROOF_CODE_PERSON = "01";
   
   /**
    * 证件名：居民身份证
    */
   public static final String PROOF_NAME_PERSON = "居民身份证";
   
   /**
    * 关注来源：微信
    */
   public static final String SOURCE_PLATFORM_WX = "XK_CH_WX";
   
   /**
    * 线上医院
    */
   public static final int ONLINE_HOSPITAL = 1;
   
   /**
    * 线下医院
    */
   public static final int OFFLINE_HOSPITAL = 0;

   /**
    * 是否关注：0（未关注）
    */
   public static final String UN_ATTENTION_FLAG = "0";
   
   /**
    * 是否关注：1（关注）
    */
   public static final String ATTENTION_FLAG = "1";
   
   /**
    * 性别编码：1(男)
    */
   public static final String GENDER_CODE_MALE = "1";
   
   /**
    * 性别编码：2(女)
    */
   public static final String GENDER_CODE_FEMALE = "2";
   
   /**
    * 性别：男性
    */
   public static final String PHR_GENDER_NAME_MALE = "男性";
   
   /**
    * 性别：女性
    */
   public static final String PHR_GENDER_NAME_FEMALE = "女性";
   
   /**
    * 性别：男
    */
   public static final String WX_GENDER_NAME_MALE = "男";
   
   /**
    * 性别：女
    */
   public static final String WX_GENDER_NAME_FEMALE = "女";
   
   /**
    * APP_CODE
    */
   public static final String APP_CODE = "xk-hsp-m-wx";
   
   /**
    * PUSH_APP_ID
    */
   public static final String PUSH_APP_ID = "xk-hsp-m-patient";
   
   /**
    * 模板消息字体颜色
    */
   public static final String TEMPLATE_FONT_COLOR = "#173177";
   
   public static final String SYSTEM = "ch";

   public static final String SUB_SYSTEM = "wx";

   public static final String MODEL = "user";

   public static final int CACHE_TIME = 7 * 24 * 60 * 60;
  
    /**
     * 统一支付接口URL
     */
    public static final String PAY_UNIFIEDORDER_URL  = "https://api.mch.weixin.qq.com/pay/unifiedorder";

    public static final String PAY_TRADE_TYPE  = "JSAPI";

    public static final String DEFAULT_CHARSET = "UTF-8";

    public static final String SIGN_TYPE = "MD5";

    public static final String REGISTER_ERR_20401 = "erPerson20401";

    public static final String REGISTER_ERR_20403 = "erPerson20403";

    public static final String REGISTER_ERR_20404 = "erPerson20404";

    public static final String REGISTER_ERR_20405 = "erPerson20405";

    public static final String REGISTER_ERR_20415 = "erPerson20415";
    
//    public static final String MONGO_DBURL = System.getProperty("storefile.mongo.url");
    
    //public static final String siteFlag = ResourceBundleReader.getBundle().getString("site.flag");
    
    public static final String siteFlagNingbo = "NINGBO";

   static{
//	   LOGGER.info("WeiXBaseConstant system ===========" + SYSTEM_ENVIRONMENT);
	//   if(StringUtils.isEmpty(SYSTEM_ENVIRONMENT) || SystemEnvironment.DEVELOP.getName().equals(SYSTEM_ENVIRONMENT)){
		   WEICHAT_APPID = "wxdcee9a18ca7e2022";//System.getProperty("integrate.weixin.weichat.appid");
		   WEICHAT_SECRET = "6426788d8fe6f1bb95cbc7316c2cc32e";//System.getProperty("integrate.weixin.weichat.secret");
		   WEICHAT_MCHID= System.getProperty("integrate.weixin.weichat.mchid");
		   WEICHAT_MCH_KEY= System.getProperty("integrate.weixin.weichat.mchkey");
		   WEIXIN_DOMAIN_URL = System.getProperty("integrate.weixin.weichat.domainurl");
		   PAY_CALL_BACK_URL  = System.getProperty("integrate.weixin.weichat.paycallbackurl");
		   SERVICE_PAY_CALL_BACK_URL  = System.getProperty("integrate.weixin.weichat.service.paycallbackurl");
		   WEIXIN_TOKEN = "hhy";//System.getProperty("integrate.weixin.weichat.token");
		   MY_DOCTOR = System.getProperty("integrate.weixin.weichat.menu.mydoctor");
		   MY_SERVICE = System.getProperty("integrate.weixin.weichat.menu.myservice");
		   TEMPLATE_CONSULTING_REMIND = System.getProperty("integrate.weixin.template.id.opentm207521738");
		   
	/*   } else if (SystemEnvironment.XK.getName().equals(SYSTEM_ENVIRONMENT)){
		   WEICHAT_APPID = ResourceBundleReader.getBundle().getString("xk.weixin.weichat.appid");
		   WEICHAT_SECRET = ResourceBundleReader.getBundle().getString("xk.weixin.weichat.secret");
		   WEICHAT_MCHID= ResourceBundleReader.getBundle().getString("xk.weixin.weichat.mchid");
		   WEICHAT_MCH_KEY= ResourceBundleReader.getBundle().getString("xk.weixin.weichat.mchkey");
		   WEIXIN_DOMAIN_URL = ResourceBundleReader.getBundle().getString("xk.weixin.weichat.domainurl");
		   PAY_CALL_BACK_URL  = ResourceBundleReader.getBundle().getString("xk.weixin.weichat.paycallbackurl");
		   SERVICE_PAY_CALL_BACK_URL  = ResourceBundleReader.getBundle().getString("xk.weixin.weichat.service.paycallbackurl");
		   WEIXIN_TOKEN = ResourceBundleReader.getBundle().getString("xk.weixin.weichat.token");
		   MY_DOCTOR = ResourceBundleReader.getBundle().getString("xk.weixin.weichat.menu.mydoctor");
		   MY_SERVICE = ResourceBundleReader.getBundle().getString("xk.weixin.weichat.menu.myservice");
		   TEMPLATE_CONSULTING_REMIND = ResourceBundleReader.getBundle().getString("xk.weixin.template.id.opentm207521738");
	   } else {
		   WEICHAT_APPID = ResourceBundleReader.getBundle().getString("online.weixin.weichat.appid");
		   WEICHAT_SECRET = ResourceBundleReader.getBundle().getString("online.weixin.weichat.secret");
		   WEICHAT_MCHID= ResourceBundleReader.getBundle().getString("online.weixin.weichat.mchid");
		   WEICHAT_MCH_KEY= ResourceBundleReader.getBundle().getString("online.weixin.weichat.mchkey");
		   WEIXIN_DOMAIN_URL = ResourceBundleReader.getBundle().getString("online.weixin.weichat.domainurl");
		   PAY_CALL_BACK_URL  = ResourceBundleReader.getBundle().getString("online.weixin.weichat.paycallbackurl");
		   SERVICE_PAY_CALL_BACK_URL  = ResourceBundleReader.getBundle().getString("online.weixin.weichat.service.paycallbackurl");
		   WEIXIN_TOKEN = ResourceBundleReader.getBundle().getString("online.weixin.weichat.token");
		   MY_DOCTOR = ResourceBundleReader.getBundle().getString("online.weixin.weichat.menu.mydoctor");
		   MY_SERVICE = ResourceBundleReader.getBundle().getString("online.weixin.weichat.menu.myservice");
		   TEMPLATE_CONSULTING_REMIND = ResourceBundleReader.getBundle().getString("online.weixin.template.id.opentm207521738");
	   }*/
//	   LOGGER.info("WEICHAT_APPID = " + WEICHAT_APPID);
//	   LOGGER.info("WEICHAT_SECRET = " + WEICHAT_SECRET);
//	   LOGGER.info("WEICHAT_MCHID = " + WEICHAT_MCHID);
//	   LOGGER.info("WEICHAT_MCH_KEY = " + WEICHAT_MCH_KEY);
//	   LOGGER.info("WEIXIN_DOMAIN_URL = " + WEIXIN_DOMAIN_URL);
//	   LOGGER.info("PAY_CALL_BACK_URL = " + PAY_CALL_BACK_URL);
//	   LOGGER.info("SERVICE_PAY_CALL_BACK_URL = " + SERVICE_PAY_CALL_BACK_URL);
//	   LOGGER.info("WEIXIN_TOKEN = " + WEIXIN_TOKEN);
//	   LOGGER.info("MY_DOCTOR = " + MY_DOCTOR);
//	   LOGGER.info("MY_SERVICE = " + MY_SERVICE);
   }





}
